package com.zhang.hadoop.flink.test2;

import com.zhang.hadoop.flink.base.ClickSource;
import com.zhang.hadoop.flink.base.Event;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author: zhang yufei
 * @createTime:2022/5/14 16:27
 * @description:
 */
public class SourceCustomerTest {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        DataStreamSource<Event> customerStream = env.addSource(new ClickSource());
        customerStream.print();
        DataStreamSource<Integer> customerParallelStream = env.addSource(new ParallelCustomSource()).setParallelism(2);
        customerParallelStream.print();
        env.execute();
    }
}
